#pragma once
#include "OCMain/Log.h"
#include "OCMain/FileUtil.h"
#include "OCMain/Date.h"
#include "OCServer/ServerUtil.h"
#include "OCMain/zip/BZip2.h"
#include "OCMain/ZipUtil.h"
#include "OCMain/cpptime.h"

using namespace OCPP;

inline StringVector findFile(String path, String ext)
{
	StringVector results;

	StringVector files = FileUtil::findFiles(path);
	for (const auto f : files)
	{
		if (StringUtil::endsWith(f, ext))
		{
			results.push_back(f);
		}
	}

	return results;
}

inline String getToday()
{
	return Date::now().roundDay().toCustomedFormattedStringLocal("%Y%m%d", false);
}

class JobTimer
{
public:
	void start();
	void doJob();
	void stop();
	static String latestFileName;
	static String dataPath;
	static String cachePath;
};
